package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.pojo.Emp;

import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface EmpMapper extends BaseMapper<Emp> {



//    @Select("select count(*) from emp e left join dept d on e.dept_id = d.id ")
//    public Long count();
//
//    /**
//     * 查询所有的员工及其对应的部门名称
//     */
//    @Select("select e.*, d.name deptName from emp  e left join dept  d on e.dept_id = d.id limit #{start}, #{pageSize}")
//    public List<Emp> list(Integer start , Integer pageSize);
//    @Select("select e.*, d.name deptName from emp as e left join dept as d on e.dept_id = d.id")
//    public List<Emp> list();
//      List<Emp> list(EmpQueryParam empQueryParam);
//      @Options(useGeneratedKeys = true, keyProperty = "id")
//@Options(useGeneratedKeys = true, keyProperty = "id")
//@Insert("insert into emp(username, name, gender, phone, job, salary, " +
//        "image, entry_date, dept_id, create_time, update_time) " +
//       "values (#{username},#{name},#{gender},#{phone},#{job},#{salary}," +
//        "#{image},#{entryDate},#{deptId},#{createTime},#{updateTime})")
//      void save(Emp emp);
//
//      /**
//       * 批量删除员工信息
//       */
//      void deleteByIds(List<Integer> ids);
//      /**
//       * 根据ID查询员工详细信息
//       */
//      @Select("select * from emp where id =#{id}")
//      Emp getByEmpId(Integer id);
//        @Override
//      int updateById(Emp emp);
//
//      /**
//       * 统计各个职位的员工人数
//       */
//
      List<Map> getEmpJobData();

//
      List<Map> countEmpGenderData();
//
//      @Select("select * from emp")
//      List<Emp> listAll();
//
//      @Select("select * from emp where username=#{username} and password=#{password}")
//      Emp findEmpByUsernameAndPassword(@Param("username") String username,
//                                       @Param("password")String password);
}